package com.test2;

import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class Client2
{
	public static void main(String[] args)
	{
		Chinese chinese = new Chinese();
		Tool tool = new ConcreteToolB();
		chinese.setTool(tool);
		chinese.work();
		
		ClassPathResource cpr = new ClassPathResource("applicationContext.xml");
		XmlBeanFactory factory = new XmlBeanFactory(cpr);
		Person p = (Person)factory.getBean("chinese2");
		p.work();
	}
}
